<script setup lang="ts">
import { onLaunch, onShow, onHide } from "@dcloudio/uni-app";
import Storage from './utils/storage';

onLaunch(() => {
  // 权限的判断，有token进入主页，无token进入登录页
      if(Storage.getCache('token')) {
        uni.switchTab({ url: '/pages/index/index' });
      } else {
        uni.navigateTo({ url: '/pages/login/login' });
      }

      uni.getSystemInfo({
      success: function (res) {
        // console.log("设备信息", res, Storage.getCache('token'));
        Storage.setCache("windowWidth", res.windowWidth);
        Storage.setCache("windowHeight", res.windowHeight);
        // uni.hideTabBar();
      },
    });
  // console.log("App Launch");
});

onShow(() => {
  // console.log("App Show");
});

onHide(() => {
  // console.log("App Hide");
});

</script>
<style lang="scss">
@import url('styles/tailwind.css');

	.uv-page {
		padding: 15px 15px 40px;
	}

</style>
